import { post } from '../http'

// 账单计划
export const getBillPlanList = (data) => post({ url: '/czsOrderInfo/billPlanList', data })

/**
 * @description: 长租订单-列表
 * @param data
 * @return Promise
 */
export const getList = (data) => post({ url: '/czsOrderInfo/pageList', data })

/**
 * @description: 长租订单-单量统计
 * @param data
 * @return Promise
 */
export const getStatistics = (data) => post({ url: '/czsOrderInfo/findStatistics', data })

/**
 * @description: 交/还车人维护
 * @param data
 * @return Promise
 */
export const editGiveReturnStaff = (data) => post({ url: '/czsOrderInfo/editGiveReturnStaff', data })

export const longPlatoonCar = (data) => post({ url: '/czsOrderInfo/platoonCar', data })

/**
 * @description: 订单完成前校验
 * @param data
 * @return Promise
 */
export const finishCheck = (data) => post({ url: '/czsOrderInfo/finishCheck', data })

/**
 * @description: 完成订单
 * @param data
 * @return Promise
 */
export const finish = (data) => post({ url: '/czsOrderInfo/finish', data })

/**
 * @description: 取消订单
 * @param data
 * @return Promise
 */
export const cancel = (data) => post({ url: '/czsOrderInfo/cancel', data })

/**
 * @description: 作废订单
 * @param data
 * @return Promise
 */
export const invalidOrder = (data) => post({ url: '/czsOrderInfo/invalidOrder', data })

/**
 * @description: 根据手机号查询
 * @param data
 * @return Promise
 */
export const findByPhone = (data) => post({ url: '/czcCustMember/findByPhone', data })

/**
 * @description: 计算租期
 * @param data
 * @return Promise
 */
export const computeRentDay = (data) => post({ url: '/czsOrderInfo/getMonthDiff', data })

/**
 * @description: 长租订单-详情
 * @param data
 * @return Promise
 */
export const getLongOrderDetails = (data) => post({ url: '/czsOrderInfo/detail', data })

// 长租订单-获取手动生产电子合同信息
export const getCzsContractInfo = (data) => post({ url: '/czsOrderInfo/contractOrderDetail', data })

/**
 * @description: 长租订单-订单费用信息
 * @param data
 * @return Promise
 */
export const getLongOrderFeeDetail = (data) => post({ url: '/czsOrderInfo/orderFeeList', data })

/**
 * @description: 长租订单-订单费用信息
 * @param data
 * @return Promise
 */
export const getLongOrderReletList = (data) => post({ url: '/czsOrderInfo/reletList', data })

/**
 * @description: 长租订单-获取账号前置信息收付款方式
 * @param data
 * @return Promise
 */
export const getAccountByPageData = (data) => {
  // 忽略退款抵扣违约金,需要显示 => 请加字段frontIsIgnore
  if ([undefined, null].includes(data.frontIsIgnore)) {
    data.ignoreWays = ['-2']
  }
  return post({ url: '/inExpAccount/getWayByType', data })
}

/**
 * @description: 长租订单-根据收付款方式和收付款类型查询账号信息
 * @param data
 * @return Promise
 */
export const getAccountByWayAndType = (data) => post({ url: '/inExpAccount/getAccountByWayAndType', data })

/**
 * @description: 长租订单-费用信息 - 去确认
 * @param data
 * @return Promise
 */
export const feetoConfirm = (data) => post({ url: '/czsOrderFee/toConfirm', data })

/**
 * @description: 长租订单-费用信息 - 确认
 * @param data
 * @return Promise
 */
export const feeSubmit = (data) => post({ url: '/czsOrderFee/confirm', data })

/**
 * @description: 长租订单-换车记录
 * @param data
 * @return Promise
 */
export const carReplaceList = (data) => post({ url: '/czsOrderInfo/replaceList', data })

/**
 * @description: 长租订单-计算订单相关的金额
 * @param data
 * @return Promise
 */
export const calcPrice = (data) => post({ url: '/czsOrderInfo/calcPrice', data })

/**
 * @description: 创建订单
 * @param data
 * @return Promise
 */
export const createOrder = (data) => post({ url: '/czsOrderInfo/createOrder', data })

/**
 * @description: 订单交车
 * @param data
 * @return Promise
 */
export const giveCar = (data) => post({ url: '/czsOrderInfo/giveCar', data })

/**
 * @description: 订单还车
 * @param data
 * @return Promise
 */
export const returnCar = (data) => post({ url: '/czsOrderInfo/returnCar', data })

/**
 * @description: 订单续租
 * @param data
 * @return Promise
 */
export const reletOrder = (data) => post({ url: '/czsOrderInfo/reletOrder', data })

/**
 * @description: 获取押金的可用金额
 * @param data
 * @return Promise
 */
export const queryActiveAmount = (data) => post({ url: '/sOrderDeposit/queryActiveAmount', data })

/**
 * @description: 订单换车
 * @param data
 * @return Promise
 */
export const replaceCar = (data) => post({ url: '/czsOrderInfo/replaceCar', data })

/**
 * @description: 添加费用
 * @param data
 * @return Promise
 */
export const addOrderCost = (data) => post({ url: '/czsOrderInfo/addOrderCost', data })

/**
 * @description: 修改承租人
 * @param data
 * @return Promise
 */
export const editMemberInfo = (data) => post({ url: '/czsOrderInfo/editMemberInfo', data })

/**
 * @description: 修改订单
 * @param data
 * @return Promise
 */
export const modifyOrder = (data) => post({ url: '/czsOrderInfo/modifyOrder', data })

/**
 * @description: 费用详情
 * @param data
 * @return Promise
 */
export const orderFeeDetail = (data) => post({ url: '/orderFee/detail', data })

/**
 * @description: 修改费用
 * @param data
 * @return Promise
 */
export const modifyOrderFee = (data) => post({ url: '/czsOrderFee/modify', data })

// 长租导出
export const czExportExcel = (data) => post({ url: '/czsOrderInfo/exportExcel', data })

// 长租分期查看账单计划
export const getCzPayable = (data) => post({ url: '/czsOrderInfo/payablePreview', data })

// 查询续租的账单计划
export const billPlanListByForm = (data) => post({ url: '/czsOrderInfo/billPlanListByForm', data })

// 获取合同编号
export const getContractNo = (data) => post({ url: '/czsOrderInfo/getContractNo', data })

// 长租操作记录列表
export const getOperateLogList = (data) => post({ url: '/czsOrderInfo/operateLogList', data })

// 查看合同
export const contractListInfo = (data) => post({ url: '/czsOrderInfo/contractList', data })

// 上传合同
export const uploadContractApi = (data) => post({ url: '/czsOrderInfo/uploadContract', data })

// 根据开始日期计算结束日期
export const calcDate = (data) => post({ url: '/tool/calcDate', data })

// 获取费用rate
export const calcRateAPI = (data) => post({ url: '/czsOrderInfo/calcRate', data })

// 费用详情-编辑前
export const czsOrderFeeDetailAPI = (data) => post({ url: '/czsOrderFee/selectById', data })

// 费用详情-合并前校验
export const checkManyToConfirm = (data) => post({ url: '/czsOrderFee/checkManyToConfirm', data })

// 获取承租人信息
export const getMemberInfo = (data) => post({ url: '/czcCustMember/findQuery', data })

// 检查承租人及手机号
export const checkMemberPhone = (data) => post({ url: '/czcCustMember/checkMember', data })

/** 删除续租 */
export const deleteRelet = (data) => post({ url: '/czsOrderInfo/deleteRelet', data })

/** 续租校验 */
export const checkRelet = (data) => post({ url: '/czsOrderInfo/modifyRerentCheck', data })

/** 修改续租后换车时间 */
export const modifyReletCarTime = (data) => post({ url: '/czsOrderInfo/modifyRerent', data })

/** 修改车牌号长租换车记录· */
export const updateReplaceList = (data) => post({ url: '/czsOrderInfo/getCzsOrderCarInfoList', data })

/** 修改车牌号 */
export const updateLongCarLicenseNo = (data) => post({ url: '/czsOrderInfo/updateCarLicenseNo', data })
/** 订单好评 */
export const orderGoodEvaluate = (data) => post({ url: '/czsOrderInfo/orderPositiveReviews', data })

/** 获取未好评订单 */
export const getNoEvaluateOrder = (data) => post({ url: '/czsOrderInfo/getPositiveReviewsAllList', data })

/** 备注操作记录 */
export const getRemarkLogApi = (data) => post({ url: '/czsOrderInfo/operateRemarkLogList', data })

/** 修改换车备注 */
export const updateRemarkLogApi = (data) => post({ url: '/czsOrderInfo/modifyReplaceCarRemark', data })

/** 添加订单备注 */
export const createRemarkApi = (data) => post({ url: '/czsOrderInfo/createOrderRemark', data })
/** 添加自定义标签 */
export const addCustomLabel = (data) => post({ url: '/czsOrderInfo/addCustomLabel', data })

// 获取押金收取方式
export const getDepositWay = (data) => post({ url: '/czsOrderInfo/getViolationDepositFee', data })

// 获取合同记录数量
export const getLongContractRecordCount = (data) => post({ url: '/czsOrderInfo/getContractNum', data })

// 核实订单
export const verifyOrder = (data) => post({ url: '/czsOrderInfo/orderAuditing', data })
